package com.styytech.dadabao.base;

import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.LayoutInflater;

import com.styytech.dadabao.widge.swipeback.SwipeBackLayout;
import com.styytech.dadabao.R;

public abstract class BaseBackActivity extends BaseActivity {
    protected SwipeBackLayout layout;
    protected Resources resources;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        layout = (SwipeBackLayout) LayoutInflater.from(this).inflate(
                R.layout.base, null);
        layout.attachToActivity(this);
        super.onCreate(savedInstanceState);
    }

    @Override
    public void startActivity(Intent intent) {
        super.startActivity(intent);
        overridePendingTransition(R.anim.base_slide_right_in,
                R.anim.base_slide_remain);
    }

    // Press the back button in mobile phone
    @Override
    public void onBackPressed() {
        super.onBackPressed();
        overridePendingTransition(0, R.anim.base_slide_right_out);
    }


}
